package com.mask.mk.controller;


import com.mask.mk.service.MUserService;
import com.mask.mk.util.JsonResult;
import com.mask.mk.vo.login.LoginRequest;
import com.mask.mk.vo.login.RegisterRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author joey
 * @since 2023-04-25
 */
@Api(tags = "前台-用户操作")
@RestController
@RequestMapping("/m-user")
public class MUserController {

    @Autowired
    private MUserService mUserService;


    @ApiOperation(value = "前台登录")
    @PostMapping("/login")
    public JsonResult checklogin(@RequestBody LoginRequest loginInfo){
        return mUserService.login(loginInfo);
    }

    @ApiOperation(value = "前台注册")
    @PostMapping("/register")
    public JsonResult register(@RequestBody RegisterRequest request){
        return mUserService.register(request);
    }


}

